
# 获取 protobuf 生成的 .cc 文件
file(GLOB PROTO_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/../*.pb.cc)

# 创建 client_performance 可执行文件
add_executable(client_performance client_performance.cc ${PROTO_SRCS})

# 创建 client_functional 可执行文件
add_executable(client_functional client_functional.cc ${PROTO_SRCS})

# 链接必要的库，尤其是 example 中生成的静态库
target_link_libraries(client_performance Rpc_core ${LIBS})
target_link_libraries(client_functional Rpc_core ${LIBS})

# 设置编译选项
target_compile_options(client_performance PRIVATE -std=c++11 -Wall)
target_compile_options(client_functional PRIVATE -std=c++11 -Wall)

# 设置 client_performance 和 client_functional 可执行文件输出目录
set_target_properties(client_performance PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set_target_properties(client_functional PROPERTIES
    RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)